﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="queue.aspx.cs" Inherits="Export.Web.Ui.pages.queue" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cp_head" runat="server">
     <script src="/Scripts/datagrid-filter.js"></script>
    <script src="/js/jquery.uniform.min.js" type="text/javascript"></script>
    <script src="/Scripts/export/queue.js"></script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cp_body" runat="server">
    <table id="queueAllList" title="Queue All" class="easyui-datagrid" style="width: auto; height: 400px;"
        rownumbers="true" toolbar="<%  { if (!HttpContext.Current.Session["Role"].ToString().Equals("3", StringComparison.CurrentCultureIgnoreCase)) { Response.Write("#toolbar"); } }%>" fitcolumns="true" singleselect="true">
        <thead>
            <tr>
                <th field="id" width="30" align="center" formatter="formatLinkOrderDetail">Transaction
                </th>
                <th field="ProductCode" width="60" align="center" sortable="true">เลขที่สินค้า
                </th>
                <th field="ProductName" width="40" align="center" sortable="true">ชื่อสินค้า
                </th>
                <th field="PlantCode" editor="text" width="20" align="center">Plant
                </th>
                <th field="OrderNo" width="45" align="center" sortable="true">เลขที่ใบสั่งซื้อ
                </th>
                <th field="RefOrderNo" width="45" align="center" sortable="true">เลขที่ใบสั่งซื้ออ้างอิง
                </th>
                <th field="Qty" width="20" editor="numberbox" align="center">QTY
                </th>
                <th field="Date" width="30" align="center" formatter="formatDate" sortable="true">วันที่สร้าง
                </th>
                <%-- <th field="Priority" width="20" align="center" sortable="true">คิวที่
                </th>--%>
                <th field="Rate" width="10" align="center">% การดึงสินค้า
                </th>
                <th field="ValidFrom" width="30" align="center" formatter="formatDate">Valid on
                </th>
                <th field="ValidTo" width="30" align="center" formatter="formatDate">Valid to
                </th>
                <th field="IsActive" width="20" align="center" formatter="formatBoolean">เปิดการรอคิว
                </th>
                <th field="UpdateBy" width="20" align="center" >แก้ไขโดย
                </th>
            </tr>
        </thead>
    </table>
    <div id="toolbar" style="display:<%  { if (!HttpContext.Current.Session["Role"].ToString().Equals("3", StringComparison.CurrentCultureIgnoreCase)) { Response.Write("display"); } else { Response.Write("none"); } }%>" >
        <a id="queuePause" href="#" class="easyui-linkbutton" iconcls="icon-pause" plain="true" onclick="updateQueueStatus(false);">Pause</a>
        <a id="queueResume" href="#" class="easyui-linkbutton" iconcls="icon-play" plain="true" onclick="updateQueueStatus(true);">Resume</a>
        <a id="queueUpdate" href="#" class="easyui-linkbutton" iconcls="icon-save" plain="true" onclick="updateQueue();">SaveAllQueue</a>
        <a id="deleteQueue" href="#" class="easyui-linkbutton" iconcls="icon-remove" plain="true" onclick="deleteQueue();">Delete</a>
    </div>


    <div id="orderDetails" class="easyui-dialog" style="width: 1000px; height: 500px; padding: 10px 20px"
        closed="true" data-options="resizable:true,modal:true">
        <div>
            Update ATP ล่าสุดเมื่อ : <b><span id="updateAtpTime"></span></b>
        </div>
        <table id="orderDetailsList" class="easyui-datagrid" style="width: auto; height: 350px;" toolbar="#toolbarOrderDetail"
            rownumbers="true" fitcolumns="true" singleselect="true">
            <thead>
                <tr>
                    <%-- <th field="OrderNo" width="30" align="center" sortable="true">เลขที่ใบสั่งซื้อ
                            </th>--%>
                    <th field="ItemId" width="50" align="center" sortable="true">เลขที่สินค้า
                    </th>
                    <th field="ItemName" width="50" align="center" sortable="true">ชื่อสินค้า
                    </th>
                    <th field="Qty" width="20" align="center" sortable="true">QTY
                    </th>
                    <th field="ReceivedQty" width="20" align="center" sortable="true">QTY ที่ได้รับ
                    </th>
                     <th field="ReviseQty" width="20" align="center" sortable="true" >QTY ที่ Revise ออก
                            </th>
                    <th field="RemainingQty" width="20" align="center" sortable="true" formatter="formatRemaining">QTY ที่รออยู่
                    </th>
                    
                    <th field="Plant" width="20" align="center" sortable="true" formatter="formatPlantChanged">Plant
                    </th>
                   <%-- <th field="ATP" width="20" align="center" sortable="true">ATP
                    </th>
                    <th field="ATPSB" width="20" align="center" sortable="true">ATP SB
                    </th>
                    <th field="ATPRY" width="20" align="center" sortable="true">ATP RY
                    </th>
                    <th field="ATPTotal" width="20" align="center" sortable="true">ATP รวม
                    </th>--%>
                   <%-- <th field="Rate" width="20" align="center" sortable="true" editor="numberbox" formatter="formatSpecialRate">%
                    </th>
                    <th field="ValidFrom" width="20" align="center" sortable="true" editor="datebox" formatter="formatDate">ValidFrom
                    </th>
                    <th field="ValidTo" width="20" align="center" sortable="true" editor="datebox" formatter="formatDate">ValidTo
                    </th>--%>
                    <th field="Comment" width="20" align="center" editor="textarea">Comment
                    </th>
                     <th field="IsDeleteFromQueue" width="10" align="center" formatter="formatDelete">Delete From Queue
                    </th>
                    <th field="OrderNo" width="20" align="center" formatter="formatLinkTransectionDetail">View Transaction
                    </th>
                </tr>
            </thead>
        </table>

        <div id="transectionDetails" class="easyui-dialog" style="width: 700px; padding: 10px 20px"
                    closed="true" data-options="resizable:true,modal:true">
                    <table id="transectionDetailsList" class="easyui-datagrid" style="width: auto; height: 300px;"
                        rownumbers="true" fitcolumns="true" singleselect="true" showfooter="true" toolbar="#transectionDetailsToolBar">
                        <thead>
                            <tr>
                                <th field="Plant" width="15" align="center">Plant
                                </th>
                                <th field="Qty" width="20" align="center" sortable="true" formatter="formatQty">QTY
                                </th>
                                <th field="PalletDetailId" width="20" align="center">PalletDetailId
                                </th>
                                <th field="Result" width="100" align="center">Mat NO From Sap
                                </th>
                                 <th field="MMoveSubCate" width="30" align="center">MMoveSubCate
                                </th>
                                 <th field="Mreverse" width="30" align="center">Mreverse
                                </th>
                                <th field="UpdateBy" width="20" align="center">UpdateBy
                                </th>
                                <th field="UpdateDate" width="20" align="center">Date
                                </th>

                            </tr>
                        </thead>
                    </table>
                    <div>
                        <div style="float: right">
                            <a href="#" class="easyui-linkbutton" onclick="javascript:jQuery('#transectionDetails').dialog('close')">Close</a>
                        </div>
                    </div>

                </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cp_scriptBelow" runat="server">
</asp:Content>
